#!/bin/bash
test2A(){
	go test -run 2A > a.txt
	res=$(awk '$0 ~ /ok/ {print $0}' a.txt)
	echo $res
	if [ -n "${res}" ]
	then 
		echo "Lab2A Passed"
		return 1
	else 
		echo "Lab2A Failed"
		return 0
	fi
}
res=1
i=1
true_res=1
max_loop=$1
while [ "$res" -eq "$true_res" -a "$i" -lt "$max_loop" ]
do
	test2A
	res=$?
	echo "res:$res,loop:$i"
	let "i++"
done
